package com.neusoft.serviceImp;

import com.neusoft.mapper.SysEmailBoxMapper;
import com.neusoft.pojo.SysEmailInbox;
import com.neusoft.service.IEmailBoxService;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmailBoxServiceImp implements IEmailBoxService {

    @Autowired(required = false)
    SysEmailBoxMapper sysEmailBoxMapper;


    @Override
    public java.util.List<SysEmailInbox> sysEmailInboxList(SysEmailInbox sysEmailInbox)
    {
        return sysEmailBoxMapper.sysEmailInboxList(sysEmailInbox);
    }

    @Override
    public boolean sysEmailInboxdelete(int emailId){
        int n= sysEmailBoxMapper.sysEmailInboxDelete(emailId);
        if(n>0)
        {
            return true;
        }
        return false;
    }

    @Override
    public java.util.List<SysEmailInbox> sysEmailTrashList(SysEmailInbox sysEmailInbox)
    {
        return sysEmailBoxMapper.sysEmailTrashList(sysEmailInbox);
    }

    @Override
    public boolean sysEmailTrashrestore(int emailId)
    {
        int n= sysEmailBoxMapper.sysEmailrestore(emailId);
        if(n>0)
        {
            return true;
        }
        return false;
    }

    @Override
    public  boolean sysEmailadd(SysEmailInbox sysEmailInbox)
    {
        int n= sysEmailBoxMapper.sysEmailadd(sysEmailInbox);
        if(n>0)
        {
            return true;
        }
        return false;
    }

    @Override
    public boolean sysEmailcheck(int emailId)
    {
        int n= sysEmailBoxMapper.sysEmailcheck(emailId);
        if(n>0)
        {
            return true;
        }
        return false;
    }

    @Override
    public java.util.List<SysEmailInbox> sysEmailcheckList()
    {
        java.util.List<SysEmailInbox> sysEmailInboxes=sysEmailBoxMapper.sysEmailInboxList_check();
        sysEmailBoxMapper.sysEmailcheck_over();
        return sysEmailInboxes;
    }

    @Override
    //保存编辑的邮件
    public boolean sysEmailsave(SysEmailInbox sysEmailInbox)
    {
        int n= sysEmailBoxMapper.saveEdit(sysEmailInbox);
        if(n>0)
        {
            return true;
        }
        return false;
    }
}
